﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

using RRRSRoguelike.Enums;
using RRRSRoguelike.Helpers;

using RRRSRoguelike.Helpers.Visualizer;
using RRRSRoguelike.Managers;
using RRRSRoguelikeData;

namespace RRRSRoguelike.Screens
{
    /// <summary>
    /// Manages the UI to enter Random Seed Number to start.
    /// </summary>
    class LanguageScreen:Screen
    {
    	Menu menu = new Menu();
    	List<long> timing = new List<long>();
        
        public LanguageScreen()
        {
            PanelList.Add(new Panel(new Point(4, 3), 
                Visualizer.GetScreenWidth() - 9, Visualizer.GetScreenHeight() - 6));                      
        	
        	SetupMenu();
        	
        }

        #region Methods
        
        public override void Show()
        {
        	Draw();
        	while(active)
        	{
        		if(menu.HandleInput())
        		menu.DrawMenu(PanelList[0]);
        	}
        }
                
        void Draw()
        {
			Clear();
        	PanelList[0].Draw();
        	menu.DrawMenu(PanelList[0]);
        }
        
        void SetupMenu()
		{
			menu.Add(new MenuItem(Properties.Strings.English,new EventHandler(SelectUS)));
			menu.Add(new MenuItem(Properties.Strings.French+ (" - needs translation."),new EventHandler(SelectFR)));
        	menu.Add(new MenuItem(Properties.Strings.Exit,new EventHandler(SelectExit)));

		}
        
        //Event method
        void SelectUS(object sender,EventArgs e)
        {
        	Language.NewLanguage("en-US");
			active = false;        	
        }
        
        //Event method
        void SelectFR(object sender,EventArgs e)
        {
        	Language.NewLanguage("fr-FR");
        	active = false;
        }
        
        void SelectExit(object sender,EventArgs e)
        {
        	active = false;
        }




        #endregion
    }
}
